package com.jjh.jhwebserver.context;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Session {

    private Map<String,Object> sessionMap = new ConcurrentHashMap<>();

    /**
     * 存session
     * @param name
     * @param obj
     */
    public void setAttribute(String name,Object obj){
        sessionMap.put(name,obj);
    }

    /**
     * 取session
     * @param name
     * @return
     */
    public Object getAttribute(String name){
        return sessionMap.getOrDefault(name, null);
    }






}
